import java.util.ArrayList;

/**
 * @projectName: LeetCode
 * @package: PACKAGE_NAME
 * @className: Point6
 * @author: Mocrash
 * @description: TODO
 * @date: 2024/10/18 12:19
 * @version: 1.0
 */
public class Point10 {
    public static void main(String[] args) {
        Solution solution = new Solution();
        /*String str = "dnjdnjdnj n";
        String ele = "dnjn";
        int index = solution.find(str, ele);
        if (index == -1) System.out.println("Not found");
        else System.out.println(str.substring(index, index + ele.length()));*/
        boolean isTrue = solution.isMatch("baa", "a*");
        System.out.println(isTrue);
    }

    private static class Solution {
        public boolean isMatch(String s, String p) {
           return false;
        }

        private ArrayList<String> split(String str, char reg) {
            ArrayList<Integer> regIndexes = new ArrayList<>();
            ArrayList<String> returner = new ArrayList<>();
            int startIndex = 0;
            for (int i = 0; i < str.length(); ++i) {
                if (str.charAt(i) == reg) {
                    regIndexes.add(i);
                }
            }
            int befInx = 0;
            for (int i = 0; i < regIndexes.size(); ++i) {
                String subStr;
                if (regIndexes.get(i) - befInx <= 1) {
                    subStr = "";
                } else {
                    subStr = str.substring(befInx + 1, regIndexes.get(i));
                }
                befInx = regIndexes.get(i);
                returner.add(subStr);
            }
            if (befInx == 0)befInx -= 1;
            returner.add(str.substring(befInx + 1));
            return returner;
        }

        private int find(String str, String ele) {
            char[] chStr = str.toCharArray();
            char[] chEle = ele.toCharArray();
            int elePoint = 0, strPoint;
            for (strPoint = 0; strPoint < chStr.length; ) {
                boolean isFind = true;
                for (int i = 0; i < chEle.length; ++i) {
                    if (strPoint + i >= chStr.length) return -1;
                    if (chEle[i] != chStr[strPoint + i] && chEle[i] != '.') {
                        elePoint = Math.max(i, elePoint);
                        isFind = false;
                        break;
                    }
                }
                if (isFind) return strPoint;
                int curChPos = find(chStr, strPoint + elePoint + 1, chStr.length, chEle[elePoint]);
                if (curChPos == -1) return -1;
                strPoint = curChPos - elePoint;
            }
            return -1;
        }

        private int find(char[] arr, int offset, int count, char ch) {
            for (int i = offset; i - offset < count; ++i) {
                if (i >= arr.length) return -1;
                if (arr[i] == ch || ch == '.') return i;
            }
            return -1;
        }
    }
}
